1. Field of the Invention
The present invention relates to the field of pixel rendering in particular to the field of rendering textured spheres and spherical environment maps.
2. Description of the Related Art
Pixel rendering refers to the generation of pixel values for displaying an image. An environment map is an image or collection of images which characterize the appearance of a scene when viewed from a particular position. Each type of environment map has an associated projection which is used to compute the appearance along a ray traveling in a particular direction towards the camera. Not all types of environment maps capture the scene in every direction.
A variety of different forms of environment maps have been used in the past. An orthographic projection of a reflecting sphere to characterize the illumination of a scene is described by Williams in "Pyramidal Parametrics", Computer Graphics, Vol. 17, No. 3, pgs. 1-11, July, 1983. The intention was to use the environment map as an aid to the rapid computation of specular reflections. In an article by Greene entitled "Environment Mapping and Order Applications of Worlds Projections", IEEE Computer Graphics and Applications, Vol. 6, No. 11, pgs. 21-49, November, 1986, six images on the faces of a cube are used for a "cubic environment map". This mapping was used to resample synthetic images of a scene to be redisplayed in the form of an Omnimax wide angle lens projection system as well as for the computation of reflections.
Spherical Environment Maps
There are a number of types of spherical projection which may be used to store environment maps. Two are of particular interest, namely spherical reflection maps, and parametric spherical maps.
Spherical reflection maps store an image of the environment as an orthographic projection of a sphere shaded with a perfect reflection of the surrounding scene. Typically, these maps are circular images of spheres within a square array of pixels. These maps are useful for the computation of reflections and illumination when rendering specular surfaces. They do, in fact, sample the entire orientation space. However, they have the disadvantage that the orientations near the silhouette of the sphere are very sparsely sampled. This renders them unsuitable as a representation for all-round interactive viewers.
Parametric spherical environment maps store the environment data in a rectangular image where the (x, y) coordinates of a pixel, map linearly to points on a sphere which are defined by the (.theta., .phi.) spherical (or angular) coordinates of a corresponding direction vector.
The relationship between the direction vector and the angular coordinates is given by: EQU D.sub.x =cos(.theta.)sin(.phi.) EQU B.sub.y =cos(.theta.)cos(.phi.) EQU D.sub.z =sin(.theta.)
Typically, a parametric spherical environment map is twice as wide as it is high since a sphere is twice the distance around the equator as it is from pole to pole. All regions are sampled at least as much as at the equator. Regions near the poles are oversampled. FIG. 1 shows a parametric spherical environment of a museum atrium. The parametric spherical environment map contains the pixel values which are used to display the parametric spherical environment.
Parametric spherical environment maps have a number of useful properties.
The environment is stored in a single contiguous image. PA1 They sample the environment completely. PA1 Translation along the equatorial direction in the map corresponds with rotation about the poles of the sphere. PA1 The environment is always sampled at least as frequently as at the equator.
Means for viewing a spherical environment map may be characterized by the algorithm used for display and by the speed with which different degrees of freedom for the view point may be updated.
KNOWN TECHNIQUES FOR RENDERING SPHERICAL ENVIRONMENT MAPS
A related area to such rendering is termed texture mapping. In texture mapping a texture file (or image) is applied to points on an object being rendered. This is conceptually analogous to putting a decal on a solid object. In any event, rendering spherical environment maps and textured spheres may be done using a number of different known approaches. The most appropriate approach for doing this will depend on the number of degrees of freedom required during an interactive viewing session. In any event, when rendering a parametric spherical environment map, one may consider the environment to be a texture on the surface of a sphere in 3-D space. A viewpoint with respect to the sphere will determine what is seen by the viewer. For example, the viewpoint may be outside the sphere looking at it as a whole, or it may be a perspective view from within the sphere.
Direct Scan-Conversion
For the general perspective case, i.e. unrestricted directions of manipulation, one approach is to compute the analytic form of the intersection between a plane (formed by the viewpoint and a scanline) and the sphere. In an article entitled "Simulation of Natural Scenes Using Textured Quadric Surfaces", Computer Graphics, Geoffrey Y. Gardner, Vol. 18, No. 3, pgs. 11-20, July, 1984, such a scheme was used for textured ellipsoids. Because the surface texture was a procedural texture which only depended on the surface (x, y, z) point, the (u, v) parameters for the surface were not required. The additional computational requirements for the (u, v) values make this general approach suitable for a non-real time system, but prohibitive for real-time use on personal computers without special rendering hardware. Such special hardware may significantly increase the cost of the computer system.
Texture Map Indirection
An alternative approach is to restrict the degrees of freedom with which the viewer may manipulate the sphere. If the sphere is in a fixed position, with a fixed size, a technique called texture map indirection may be used. The sphere is first rendered into a look-up-table, which is the same size as the final image. This is known as the screen look-up-table. Each look-up-table pixel contains the surface (u, v) value for the rendered sphere.
The "u" index is along the equator; while the "v" index is between the poles. When computing the final image, the contents of the screen look-up-table are used to index into the parametric spherical environment map. If this is done directly, this process would always obtain the same image of the sphere. However, if the sphere u index is offset before being used to look up the texture value, the spherical texture appears to rotate about an axis passing through the poles. This has the effect of allowing a single rotational degree of freedom for the textured sphere or spherical environment. This technique is similar to that described in an article entitled "An Image Synthesizer", Ken Perlin, Computer Graphics, Vol. 19, No. 3, pgs. 287-296, 1985. In the article, the shading is being changed for a fixed geometric scene.